import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/third_party_violation_entity.dart';

ThirdPartyViolationEntity $ThirdPartyViolationEntityFromJson(Map<String, dynamic> json) {
  final ThirdPartyViolationEntity thirdPartyViolationEntity = ThirdPartyViolationEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    thirdPartyViolationEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    thirdPartyViolationEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    thirdPartyViolationEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    thirdPartyViolationEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    thirdPartyViolationEntity.deleted = deleted;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    thirdPartyViolationEntity.id = id;
  }
  final String? thirdPartyCompanyId = jsonConvert.convert<String>(json['thirdPartyCompanyId']);
  if (thirdPartyCompanyId != null) {
    thirdPartyViolationEntity.thirdPartyCompanyId = thirdPartyCompanyId;
  }
  final String? thirdPartyCompanyName = jsonConvert.convert<String>(json['thirdPartyCompanyName']);
  if (thirdPartyCompanyName != null) {
    thirdPartyViolationEntity.thirdPartyCompanyName = thirdPartyCompanyName;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    thirdPartyViolationEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    thirdPartyViolationEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    thirdPartyViolationEntity.updateDate = updateDate;
  }
  final String? violationDate = jsonConvert.convert<String>(json['violationDate']);
  if (violationDate != null) {
    thirdPartyViolationEntity.violationDate = violationDate;
  }
  final String? violationDesc = jsonConvert.convert<String>(json['violationDesc']);
  if (violationDesc != null) {
    thirdPartyViolationEntity.violationDesc = violationDesc;
  }
  final String? violationHandel = jsonConvert.convert<String>(json['violationHandel']);
  if (violationHandel != null) {
    thirdPartyViolationEntity.violationHandel = violationHandel;
  }
  final String? violationLocation = jsonConvert.convert<String>(json['violationLocation']);
  if (violationLocation != null) {
    thirdPartyViolationEntity.violationLocation = violationLocation;
  }
  return thirdPartyViolationEntity;
}

Map<String, dynamic> $ThirdPartyViolationEntityToJson(ThirdPartyViolationEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['id'] = entity.id;
  data['thirdPartyCompanyId'] = entity.thirdPartyCompanyId;
  data['thirdPartyCompanyName'] = entity.thirdPartyCompanyName;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['violationDate'] = entity.violationDate;
  data['violationDesc'] = entity.violationDesc;
  data['violationHandel'] = entity.violationHandel;
  data['violationLocation'] = entity.violationLocation;
  return data;
}

extension ThirdPartyViolationEntityExtension on ThirdPartyViolationEntity {
  ThirdPartyViolationEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? id,
    String? thirdPartyCompanyId,
    String? thirdPartyCompanyName,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? violationDate,
    String? violationDesc,
    String? violationHandel,
    String? violationLocation,
  }) {
    return ThirdPartyViolationEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..id = id ?? this.id
      ..thirdPartyCompanyId = thirdPartyCompanyId ?? this.thirdPartyCompanyId
      ..thirdPartyCompanyName = thirdPartyCompanyName ?? this.thirdPartyCompanyName
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..violationDate = violationDate ?? this.violationDate
      ..violationDesc = violationDesc ?? this.violationDesc
      ..violationHandel = violationHandel ?? this.violationHandel
      ..violationLocation = violationLocation ?? this.violationLocation;
  }
}
